package com.winsdom.dto;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;


@Data
public class SysUserDTO {
    private Long id;

    @NotNull(message = "分类ID不能为空")
    private Long categoryId;

    @NotBlank(message = "用户名不能为空")
    private String name;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确（11位且以1开头）")
    private String phone;

    private Integer status;

    @NotNull(message = "角色ID数组不能为null")
    @Size(min = 1, message = "至少需要选择一个角色")
    private Long[] roleIds;
}
